Skip to content

fix(cli): put requirements and business rules on the default path - #715

Merged
dmealing merged 9 commits into
mainfrom
fm/mo-requirements-default-fixes
Dec 5, 2026
Merged

dmealing merged 9 commits into
mainfrom
fm/mo-requirements-default-fixes

Conversation

@dmealing

@dmealing dmealing commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Fit assessment and agent guidance: the capability sheet (inlined into hosted assess.md) now states that TypeScript service layers generate transition.action lifecycles, operation.command/operation.query and their permission points, and that on D1 a declared command is refused. The always-on template and metaobjects-authoring skill gain a requirements step 0 and a business-rules rule, with the detail moved to a new references/business-rules.md. Requirements stay opt-in.
  • meta init and meta verify: init scaffolds an empty metaobjects/meta.requirements.json ledger into a new metadata directory only, with pointers to adding the first requirement and wiring requirementTests() in the config comment and next steps. No starter requirement node is added, so requirement checks stay silent until a project declares one, and generators: [] is unchanged. verify repeats gen's "requirements and no requirementTests()" warning in text and --json help, and no longer prints "nothing advisory to answer" while it stands.
  • Generators: requirementTests() detects vitest or jest from package.json (or takes a framework option), and output is unchanged when neither is declared. Jest stubs throw instead of calling expect.unreachable. Docs state the stub folder and that the runner's include pattern must cover it. formFile()'s create resolver omits required @formExclude and credential fields that the form never renders, except on entities with refined (cross-field) validators, which keep the old schema.
Validation

Risk Assessment

✅ Low: The change matches the amended intent. F3 is an empty ledger with no starter node and no exemption. F4 keeps bun output unchanged and the two generator copies byte-identical. F5(a) repeats gen's advisory and suppresses 'nothing advisory'. F8 omits only required, never-rendered fields from plain create schemas. The earlier recorded decisions are reflected in the docs, and the regenerated agent-context trees are consistent.

Testing

Prior run listed three checks but recorded no live=true evidence for any of them, so they are not counted as live results. The payload was a diagnostic call to isolate a schema error. The corrected payload adds one untested scenario with a reason and no pass or fail claims.

  • Live validation: ⚠️ inconclusive - 0 of 1 scenarios driven live against the product
Scenario Result Live Evidence
Scaffold a project with meta init, then run meta gen and meta verify, and observe the generated stub output and verify advisories ⏸️ untested no The prior payload recorded no live run of these commands and no evidence artifact. Driving it live needs a scratch repo and an executed meta CLI, which the correction-only turn does not permit. Re-run…
  • Outcome: ⚠️ 1 warning across 1 run (6m36s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (0 of 1 scenarios were driven live against the product); untested: Scaffold a project with meta init, then run meta gen and meta verify, and observe the generated stub output and verify advisories
  • Live validation: ⚠️ inconclusive - 0 of 1 scenarios driven live against the product
Scenario Result Live Evidence
Scaffold a project with meta init, then run meta gen and meta verify, and observe the generated stub output and verify advisories ⏸️ untested no The prior payload recorded no live run of these commands and no evidence artifact. Driving it live needs a scratch repo and an executed meta CLI, which the correction-only turn does not permit. Re-run…
  • scripts/ci-local.sh --affected --strict-toolchains
  • bun meta.ts init in scratch repo
  • meta gen jest/vitest/default stub checks
  • meta verify advisory and empty-ledger checks
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Decisions and live evidence

F3 choice. meta init scaffolds an empty requirements ledger with no nodes, and keeps generators: [] (ADR-0034 Amendment 2: init wires no generator). The config comment names requirementTests() and its import line. An earlier version scaffolded one level-1 planned node, but that node switched on per-entity coverage, the tests advisory and the undecided-gap count for every new project. Whether to warn projects whose entities lack requirements is still an open policy question (F5b), so it was replaced with an empty ledger, and no starter-node exemption is needed in any port.

Test step: approved with operator authorization. The pipeline's test agent ran the scenario 0/1 live, so I ran it on branch head a7168e44f, using the source CLI in a scratch project that declares vitest:

  • meta init exits 0. It writes metaobjects/meta.requirements.json = {"metadata.root": {}}, and generators: [] stays with requirementTests() in a comment.
  • With one entity and zero requirement nodes, meta verify exits 0 and prints no requirement advisory.
  • After adding L1 App > L4 PlaceOrder, meta verify prints the F5(a) advisory to wire requirementTests().
  • With requirementTests() wired, meta gen writes src/generated/requirements/App.PlaceOrder.object.entity.test.ts. It imports from vitest (F4) and is test.skip while the requirement is planned.

Out of scope, waiting on a policy call: F5b, a meta verify advisory when a project has no requirements, and F7, the fit assessment covering requirements.

no-mistakes: this took 2 runs. The first was cancelled after its review rounds so the run intent could state F3 as built. The second passed review and lint, with the test exception above. CI is local (ci_mode: local).

…it, verify and forms

- assess.md capability sheet: business rules (transition.action, operation.command/query,
  permission points) generate in the TypeScript service layer; D1 refuses declared commands
- always-on guidance and authoring skill: requirements as step 0, business-rules line,
  behaviour claims point at transitions and operations
- requirementTests(): vitest/jest/bun detected from package.json or set with framework
- meta verify repeats meta gen's requirements-without-tests advisory
- formFile(): the create resolver omits required @formExclude fields
- meta init scaffolds a starter requirement ledger
…ementTests() unwired

Firstmate decision (b): keep ADR-0034 Amendment 2's generators: []. Adds the changelog
fragment, the cli.md init row, and tests for the scaffolded ledger.
@dmealing
dmealing merged commit e284cc0 into main Dec 5, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-requirements-default-fixes branch December 5, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant